package kr.hkit.androidcomplete03.ch30;

import kr.hkit.androidcomplete03.R;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;

public class MusicServiceTest extends Activity implements OnClickListener {
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.musicservice);
		findViewById(R.id.start).setOnClickListener(this);
		findViewById(R.id.stop).setOnClickListener(this);
	}

	public void onClick(View v) {
		switch (v.getId()) {
		case R.id.start:
			startService(new Intent(this, MusicService.class));
			break;
		case R.id.stop:
			stopService(new Intent(this, MusicService.class));
			break;
		}
	}
}
